package com.ethink.order.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ethink.order.api.info.TocSaleImportLogDetailInfo;
import com.ethink.order.api.info.TocSaleImportLogInfo;
import com.ethink.order.api.model.TocSaleImportLogModel;
import com.ethink.order.api.request.*;
import com.ethink.order.api.response.TocSaleImportLogQueryDetailResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * TOC销售单导入日志 Facade接口
 *
 * @author default
 * @date 2022-11-22
 */
@FeignClient(name = "ethink-order-service", path = "order-service/facade/v1/tocSaleImportLog", contextId = "tocSaleImportLogFacade")
public interface TocSaleImportLogFacade {

    @PostMapping("addTocSaleOrder")
    @ResponseBody
    Integer addTocSaleOrder(@RequestBody TocSaleImportLogAddRequest request);

    @PostMapping("pageQuery")
    @ResponseBody
    Page<TocSaleImportLogModel> pageQuery(@RequestBody TocSaleImportLogQueryRequest request);

    @GetMapping("delete")
    @ResponseBody
    Integer delete(@RequestParam("id") Long id);

    @GetMapping("queryDetail")
    @ResponseBody
    TocSaleImportLogQueryDetailResponse queryDetail(@RequestParam("id") Long id);

    @PostMapping("updateStatus")
    @ResponseBody
    Integer updateStatus(@RequestBody SaleOrderUpdateStatusRequest request);

    @PostMapping("queryDetailByShopOrderNoAndMateSku")
    @ResponseBody
    List<TocSaleImportLogDetailInfo> queryDetailByShopOrderNoAndMateSku(@RequestBody List<TocSaleImportLogDetailQueryRequest> requests);

    @PostMapping("queryDetailByShopOrderNo")
    @ResponseBody
    List<TocSaleImportLogDetailInfo> queryDetailByShopOrderNo(@RequestBody List<String> shopOrderNoList);

    /**
     * 未处理的log
     *
     * @return
     */
    @GetMapping("selectNotProcessed")
    @ResponseBody
    List<Long> selectNotProcessed();

    @PostMapping("queryDetailByIds")
    @ResponseBody
    List<TocSaleImportLogDetailInfo> queryDetailByIds(@RequestBody List<Long> ids);

    @GetMapping("queryById")
    @ResponseBody
    TocSaleImportLogInfo queryById(@RequestParam("id") Long id);

    @PostMapping("checkShopOrderNoIfExist")
    @ResponseBody
    List<String> checkShopOrderNoIfExist(@RequestBody CheckShopOrderNoIfExistRequest checkShopOrderNoIfExistRequest);
}